    //
//  RootViewController.m
//  Untitled
//
//  Created by zou leeging on 11-1-7.
//  Copyright 2011 apple. All rights reserved.
//

#import "AddInfoViewController.h"


@implementation AddInfoViewController

// The designated initializer.  Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
/*
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization.
    }
    return self;
}
*/


// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView {
	[super loadView];
	
	UIImage *img = [UIImage imageNamed:@"loginback.png"];
	UIImageView *background = [[UIImageView alloc]initWithFrame:
							   CGRectMake(0, 0, img.size.width, img.size.height)];
	background.image = img;
	[self.view addSubview:background];
	[background release];
	
	UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(60, 50, 100, 30)];
	label.text = @"订票数量";
	label.backgroundColor = [UIColor clearColor];
	[self.view addSubview:label];
	[label release];
	
	ticketCount = [[UITextField alloc]initWithFrame:CGRectMake(150, 50, 50, 30)];
	ticketCount.borderStyle = UITextBorderStyleRoundedRect;
	ticketCount.keyboardType = UIKeyboardTypePhonePad;
	ticketCount.text = @"1";
	ticketCount.delegate = self;
	[self.view addSubview:ticketCount];
	[ticketCount release];
	
	UIButton *button1 = [[UIButton alloc]initWithFrame:CGRectMake(60, 100, 200, 40)];
	[button1 setBackgroundImage:[UIImage imageNamed:@"contact.png"] forState:UIControlStateNormal];
	[button1 setTitle:@"联系人信息" forState:UIControlStateNormal];
	[button1  addTarget:self action:@selector(addContactInfo) forControlEvents:UIControlEventTouchUpInside];
	[self.view addSubview:button1];
	[button1 release];
	
	UIButton *button2 = [[UIButton alloc]initWithFrame:CGRectMake(60, 180, 200, 40)];
	[button2 setBackgroundImage:[UIImage imageNamed:@"contact.png"] forState:UIControlStateNormal];
	[button2 setTitle:@"登机人信息" forState:UIControlStateNormal];
	[button2 addTarget:self action:@selector(addPassengerInfo) forControlEvents:UIControlEventTouchUpInside];
	[self.view addSubview:button2];
	[button2 release];
	
	UIButton *button3 = [[UIButton alloc]initWithFrame:CGRectMake(60, 260, 200, 40)];
	[button3 setBackgroundImage:[UIImage imageNamed:@"contact.png"] forState:UIControlStateNormal];
	[button3 setTitle:@"行程单信息" forState:UIControlStateNormal];
	[button3 addTarget:self action:@selector(xingchengdan) forControlEvents:UIControlEventTouchUpInside];
	[self.view addSubview:button3];
	[button3 release];
	
	UIButton *nextStep = [[UIButton alloc]initWithFrame:CGRectMake(190, 340, 100, 35)];
	[nextStep setBackgroundImage:[UIImage imageNamed:@"nextstep.png"] forState:UIControlStateNormal];
	[nextStep setTitle:@"下一步" forState:UIControlStateNormal];
	[nextStep addTarget:self action:nil forControlEvents:UIControlEventTouchUpInside];
	[self.view addSubview:nextStep];
	[nextStep release];
}

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {

	//NSLog(@"touches began!");
	[ticketCount resignFirstResponder];
}

-(void)addContactInfo {

	ContactInfoViewController *contactView = [[ContactInfoViewController alloc]init];
	[self.navigationController pushViewController:contactView animated:YES];
	[contactView release];
}

-(void)addPassengerInfo {

	PassengerViewController *controller = [[PassengerViewController alloc]init];
	[self.navigationController pushViewController:controller animated:YES];
	[controller release];
}

-(void)xingchengdan {

	Xingchengdan *controller = [[Xingchengdan alloc]init];
	[self.navigationController pushViewController:controller animated:YES];
	[controller release];
}
/*
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
    [super viewDidLoad];
}
*/

/*
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations.
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
*/

- (void)didReceiveMemoryWarning {
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc. that aren't in use.
}

- (void)viewDidUnload {
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}


- (void)dealloc {
    [super dealloc];
}


@end
